package com.ty.day2;

import java.util.Arrays;
import java.util.regex.Pattern;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/23 10:55
 */
public class One {
    public static void main(String[] args) {
        /*String s = new String("aa123asd12d1233d1233d1f31dd123");
        String[] split = s.split("[0-9]+");
        System.out.println(Arrays.toString(split));
        split = s.split("\\d+");
        System.out.println(Arrays.toString(split));
        split = s.split("\\d{1,}");
        System.out.println(Arrays.toString(split));
        split = s.split("[a-zA-Z]{1,}");
        System.out.println(Arrays.toString(split));
        String s1 = "1988.10.10";
        String result = s1.replace(".", "-");
        System.out.println(result);
        String[] strings = s1.split("\\.");
        result = "";
        for (int i = 0; i < strings.length; i++) {
            result = result + strings[i];
            if (i < strings.length - 1) {
                result += "-";
            }
        }
        System.out.println(result);
        String a = "1,2,3,4,5,6,7,8,9";
        String[] split1 = a.split(",");
        int count = 0;
        for (int i = 0; i < split1.length; i++) {
            count += Integer.parseInt(split1[i]);
            Integer.valueOf(split1[i]);
        }
        System.out.println(count);
        String str="0123456789";
        String[] split = str.split("");
        System.out.println(String.join("-",split));
        String s="";
        for (int i = 0; i < str.length(); i++) {
            s=s+str.charAt(i);
            if (i<str.length()-1){
                s+="-";
            }
        }
        System.out.println(s);
        String str1="astomadtomatomtsdomtomm";;
        String name="tom";
        System.out.println(Arrays.toString(str1.split(name, 3)));
        System.out.println(str1.replaceAll("tom",name.toUpperCase()));
        int index=0;
        while (true){
            index=str1.indexOf(name,index);
            if (index==-1){
                break;
            }else {
                str1 = str1.substring(0, index)
                        + str1.substring(index, index + name.length()).toUpperCase()
                        + str1.substring(index + name.length());
            }
        }
        System.out.println(str1);*/
        char[] i = {'0','1'};
        System.out.println(String.copyValueOf(i));
        String email="231@qq.com";
        System.out.println();
    }
}
